Skip to content

Comments

Контрольная работа 2, Николай Шестаков#18

Open
NicholayShestakov wants to merge 23 commits intomainfrom
control_work_2
Open

Контрольная работа 2, Николай Шестаков#18
NicholayShestakov wants to merge 23 commits intomainfrom
control_work_2

Conversation

@NicholayShestakov
Copy link
Owner

Add

  • Куча нерабочего текста

Copy link
Collaborator

@WoWaster WoWaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Есть пачка лишних файлов, давайте считать, что они уже вошли в балл для очереди

#include <stdio.h>

/*
Compares two numbers in binary form без ведущих нулей, исключая число 0.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ваш рунглиш звучит очень подозрительно

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Содержательно, с учётом ограничений похоже на правду. 10 баллов.


/*
Pops value from the queue.
If queue is empty, returns -1.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не лучшая идея, потому что -1 -- валидное значение, которое можно запихнуть в очередь

Comment on lines +8 to +9
struct ListElement* next;
struct ListElement* prev;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не очень понимаю, зачем Вам здесь двусвязный список

Comment on lines +49 to +50
newElement->prev = queue->rHead;
queue->rHead = newElement;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь, видимо старой голове нужно next заполнять

currentElement->prev = temp;

previousElement = currentElement;
currentElement = currentElement->next;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вероятно prev?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Или даже что-то от tmp. Я честно говоря запутался с Вашими ссылками

}

int value = queue->fHead->value;
ListElement* newHead = queue->fHead->prev;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А если здесь NULL?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тестов маловато, косяков много, но вообще говоря, идею Вы поняли и если бы взяли обычные односвязные списки всё бы удалось, логика правильная :) 10 баллов.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants